package com.dailyblue.java.standard.thread.demo;

public class Consumer extends Thread {
    private Dealer dealer;

    public Consumer(Dealer dealer) {
        this.dealer = dealer;
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            Goods g = dealer.shipping();
            System.out.println("消费者购买了：" + g);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
